# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=vala
pkgver=0.56.14
pkgrel=0
pkgdesc="Compiler for the GObject type system"
url="https://wiki.gnome.org/Projects/Vala"
arch="all"
license="LGPL-2.0-or-later"
subpackages="$pkgname-devhelp $pkgname-dbg $pkgname-doc"
depends="glib-dev"
makedepends="libxslt-dev bash flex bison gobject-introspection-dev graphviz-dev"
checkdepends="dbus-x11"
source="https://download.gnome.org/sources/vala/${pkgver%.*}/vala-$pkgver.tar.xz"

prepare() {
	default_prepare
	# 2 failures
	sed -i "/constants\/member-access/d" \
		tests/Makefile.in
}

build() {
	CFLAGS="$CFLAGS -O2 -flto=auto" \
	CXXFLAGS="$CXXFLAGS -O2 -flto=auto" \
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
f13e7916acaba220bf8a0fb8825bf9a125fadcc13011c4e4f426e5d3a5af650543457294bede66dc5e1c742dd9b55f722a65b880e4737a6b480365c9df4c8c8b  vala-0.56.14.tar.xz
"
